package com.chushouya.manager.dto.admin.notice;

import com.chushouya.manager.constants.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.general.framework.core.enums.StatusEnum;
import com.general.framework.core.lang.Dates;
import com.chushouya.manager.constants.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
@ApiModel("消息通知列表")
public class NoticeListDTO {

    @ApiModelProperty("消息通知ID")
    private Long noticeId;

    @ApiModelProperty("消息标题")
    private String title;

    @ApiModelProperty("消息内容")
    private String content;

    @ApiModelProperty("消息场景")
    private String bizScene;

    @ApiModelProperty("消息场景")
    private String bizSceneDesc;

    @ApiModelProperty("重要级别(1日常通知 2重要通知)")
    private Integer noticeLevel;

    @ApiModelProperty("推送方式")
    private Integer pushType;

    @ApiModelProperty("短信模板(当推送类型为短信时)")
    private String smsTemplate;

    @ApiModelProperty("发送类型(1手动发送 2定时发送)")
    private Integer publishType;

    @ApiModelProperty("发送时间")
    @JsonFormat(pattern = Dates.FMT_FULL_TIME)
    private Date publishTime;

    @ApiModelProperty("发送目标用户")
    private Integer publishGroup;

    @ApiModelProperty("发布状态(0待发送,1已发送,2发送失败)")
    private Integer publishStatus;

    @ApiModelProperty("状态")
    private Integer status;

    @ApiModelProperty("最后操作人")
    private String handleUser;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = Dates.FMT_FULL_TIME)
    private Date createTime;

    @ApiModelProperty("修改时间")
    @JsonFormat(pattern = Dates.FMT_FULL_TIME)
    private Date updateTime;

    private String noticeTypeDesc;

    private String noticeLevelDesc;

    private String pushTypeDesc;

    private String publishTypeDesc;

    private String publishGroupDesc;

    private String publishStatusDesc;

    private String statusDesc;

    public String getStatusDesc() {
        return StatusEnum.getDesc(this.status);
    }

    public String getBizSceneDesc() {
        return BizScene.getTitle(this.bizScene);
    }

    public String getNoticeLevelDesc() {
        return NoticeLevelEnum.getDesc(this.noticeLevel);
    }

    public String getPushTypeDesc() {
        return NoticePushTypeEnum.getDesc(this.pushType);
    }

    public String getPublishTypeDesc() {
        return PublishTypeEnum.getDesc(this.publishType);
    }

    public String getPublishGroupDesc() {
        return NoticePublishGroupEnum.getDesc(this.publishGroup);
    }

    public String getPublishStatusDesc() {
        return NoticePublishStatusEnum.getDesc(this.publishStatus);
    }
}
